<script setup lang="ts">
import {ElRow, ElCol, ElSkeleton, ElCard, ElDivider, ElLink} from 'element-plus'
import {useI18n} from '@/hooks/web/useI18n'
import {ref, reactive} from 'vue'
import {Highlight} from '@/components/Highlight'
import {workplaceList} from "@/api/workplace";
import type {WorkplaceTotal, Project, Dynamic, Team} from '@/api/dashboard/workplace/types'
import {set} from 'lodash-es'

const loading = ref(true)

// 获取统计数
let totalSate = reactive<WorkplaceTotal>({
  project: 0,
  access: 0,
  todo: 0
})

const dynamicData = ref([])

const getAllApi = async () => {
  let res = await  workplaceList()
  console.log(res);
  if (res){
    dynamicData.value = res.data.dynamic
  }
  loading.value = false
}

getAllApi()

const {t} = useI18n()
</script>

<template>
  <ElRow class="mt-20px" :gutter="20" justify="space-between">
    <ElCol :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="mb-20px">
      <ElCard shadow="never" class="mt-20px">
        <ElSkeleton :loading="loading" animated>
          <div v-for="item in dynamicData">
            <div class="flex items-center">
              <div>
                <div class="text-14px">
                  <Highlight>
                    {{item.remark}}
                  </Highlight>
                </div>
                <div class="mt-15px text-12px text-gray-400">
                  {{item.created_time}}
                </div>
              </div>
            </div>
            <ElDivider/>
          </div>
        </ElSkeleton>
      </ElCard>
    </ElCol>
  </ElRow>
</template>
